<?php // no direct access
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/


defined('_JEXEC') or die('Restricted access'); 
?>
<script type="text/javascript">
<!--
	Window.onDomReady(function(){
		document.formvalidator.setHandler('passverify', function (value) { return ($('password').value == value); }	);
	});
// -->

function myValidate() {
	var f = document.josForm;
   if (document.formvalidator.isValid(f)) {
      f.check.value='<?php echo JUtility::getToken(); ?>'; //send token
      return true; 
   } else {
      var msg = 'Some values in Basic Information are not acceptable. Please retry.';
      alert(msg);
   }
   return false;
}

</script>

<?php
	if(isset($this->message)){
		$this->display('message');
	}
?>

<form action="<?php echo JRoute::_( 'index.php?option=com_jajobboard&view=jauserregister' ); ?>" method="post" id="josForm" name="josForm" class="form-validate"   enctype="multipart/form-data">

<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
	Đăng ký tìm việc
</div>
<?php endif; ?>
<div id="general-information">
	<h2 class="contentheading"><?php echo JText::_('Basic information'); ?></h2>
	<table class="tabledata">
	<tr>
		<td width="20%" height="40">
			<label id="namemsg" for="name">
				<?php echo JText::_( 'Name' ); ?>:
			</label>
		</td>
	  	<td>
	  		<input type="text" name="name" id="name" size="40" value="<?php echo JRequest::getVar('name');?>" class="inputbox required" maxlength="50" /> <font color="red">*</font>
	  	</td>
	</tr>
	<tr>
		<td height="40">
			<label id="usernamemsg" for="username">
				<?php echo JText::_( 'User name' ); ?>:
			</label>
		</td>
		<td>
			<input type="text" id="username" name="username" size="40" value="<?php echo JRequest::getVar('username');?>" class="inputbox required validate-username" maxlength="25" /> <font color="red">*</font>
		</td>
	</tr>
	<tr>
		<td height="40">
			<label id="emailmsg" for="email">
				<?php echo JText::_( 'Email' ); ?>:
			</label>
		</td>
		<td>
			<input type="text" id="email" name="email" size="40" value="<?php echo JRequest::getVar('email');?>" class="inputbox required validate-email" maxlength="100" /> <font color="red">*</font>
		</td>
	</tr>
	<tr>
		<td height="40">
			<label id="pwmsg" for="password">
				<?php echo JText::_( 'Password' ); ?>:
			</label>
		</td>
	  	<td>
	  		<input class="inputbox required validate-password" type="password" id="password" name="password" size="40" value="" /> <font color="red">*</font>
	  	</td>
	</tr>
	<tr>
		<td height="40">
			<label id="pw2msg" for="password2">
				<?php echo JText::_( 'Verify Password' ); ?>:
			</label>
		</td>
		<td>
			<input class="inputbox required validate-passverify" type="password" id="password2" name="password2" size="40" value="" /> <font color="red">*</font>
		</td>
	</tr>	
	</table>
	<?php //echo $this->params->render(); ?>
</div>
<div id="jobseeker" style="margin-top: 20px">
	
		<table class="tabledata">		    	
	    <?php
	    $k=0;
	    for($i = 0, $n = count($this->fieldlist); $i < $n; $i++ ){
        $field = $this->fieldlist[$i];
        $field_name = $field->field_name;
        if($field->display=='admin_only')
            continue;
        ?> 
         <?php if($field->field_type=='SEPERATOR' && $field->display!='hide_all'){?>	
  	</table>
			    							
					
		<h2 class="contentheading"><?php echo JText::_($field->label);?></h2>
     <table class="tabledata">
              <?php }else{ ?>  
             		<?php
                	$edit = $this->item_resume->id?true:false;			                        
                	$input = rendfield($this->item_resume, $field, false, $edit);
	                if($field->display=='hide_all'){
		        		echo $input; 
		        		continue;
		        	}
                    ?>
                    <?php if($input!='' && ((!$edit && $field->display!='hide_on_new') || $edit)){?>
             		<tr class="row<?php echo $k; ?>">
                      <td width="20%" style="text-align:left;" valign="top">
                      <?php echo JText::_($field->label); ?>:
                      </td>
                      <td>
                         <?php echo $input;?>
                      </td>
                  </tr>      
                
              	<?php }
             }
      
          		$k = 1 - $k;
            }
            ?>
			
      
	</table>
</div>	

	<div style="width: 100%; text-align: center; margin-top: 20px">
		<button onclick="return myValidate();" class="button" type="submit"><?php echo JText::_('Register'); ?></button>
	</div>
	
	<input type="hidden" name="task" value="register_resume_save" />
	<input type="hidden" name="id" value="0" />
	<input type="hidden" name="gid" value="0" />
	<input type="hidden" name="usertype" value="jobseeker" />
	<input type="hidden" name="layout" value="regjobseekerform" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
